# ================================================
# trigo.py - CheckNerds Labs API testing script.
# http://www.checknerds.com
# 
# Original Author: CNBorn, http://cnborn.net, 2009
# 
#
# ================================================

'''
Usage: 
	Create your .checknerds file in your home directory(for example, /home/yourname/.checknerds)
	
	cp ./.checknerds.sample ~/.checknerds

	Edit ~/.checknerds, filled in with your CheckNerds ID and ApiKey
'''

#from checknerds import *
import checknerds.validator

import httplib, urllib
import hashlib
import datetime
import csv
import getpass

print "Connecting to server..."

cn = checknerds.validator.checknerdsValidator()
cn.getConfigFromFile("/home/cnborn/.checknerds")
#cn.validate(None, None)

if cn.debug_mode == 0:
	cn.validate(74611, "0b34d532fca3bf5efd72be82f3edc8b1")
else:
	cn.validate(cn.debug_appid, cn.debug_servicekey)
#print cn.get_friends(206)

print cn.userid
#print cn.get_user(cn.userid)
#print cn.get_friends(1)
#print cn.get_useritems(cn.userid)
print cn.get_items()
print cn.get_items(done=True)


print cn.add_item(name=str(hashlib.md5(str(datetime.datetime.now())).hexdigest())[:8])

